﻿
<div class="form-horizontal" ms-controller="KJZZ">
    <div style="margin: 0 80px;">
        <div> 
            <ul class="clearfix" style="display: block;padding:0">
                <li class="add-item add-widthall">
                    <label class="add-item-label"><i>*</i>课件文件类型</label>
                    <div class="add-ic">
                        <div class="checkbox checkbox-inline"  ms-click="ChangeKJtype(1)" style="padding-left:0px">
                            <div class="icheckbox_square-blue" ms-class-1="checked:modelData.KJType==1" id="inlineCheck1"> 
                                <span class="iconfont icon-check ft12"></span>
                            </div> 
                            <label style="padding:0">视频 </label>
                        </div> 
                        <div class="checkbox checkbox-inline" ms-click="ChangeKJtype(2)" style="padding-left:0px">
                            <div class="icheckbox_square-blue" ms-class-1="checked:modelData.KJType==2" id="inlineCheck2">
                                <span class="iconfont icon-check ft12"></span>
                            </div>
                            <label style="padding:0">文档 </label>
                        </div> 
                    </div>
                </li>
                <li class="add-item add-widthall">
                    <label class="add-item-label"><i>*</i>课件名称</label>
                    <div class="add-ic">
                        <input type="text" class="form-control szhl_require" ms-duplex="modelData.KJName" />
                    </div>
                </li>

                <li class="add-item add-widthall">
                    <label class="add-item-label"> 主讲人</label>
                    <div class="add-ic">
                        <input type="text" class="form-control" ms-duplex="modelData.KJZJR" />
                    </div>
                </li>
                <li class="add-item add-widthall">
                    <label class="add-item-label">{{modelData.KJType==1?"视频":"文档"}}</label>
                    <div class="add-ic">
                        <input type="text" ms-duplex="modelData.Files" class="form-control szhl_Upload" />
                    </div>
                </li>
            </ul>
        </div>

    </div>
</div>
<script>
    var tempmodel = avalon.define({
        $id: "KJZZ",
        name: "课件制作",
        iswf: true,//是否属于流程表单
        FileData: {},
        ChangeKJtype: function (type) {
            tempmodel.modelData.KJType = type;
        },
        inittemp: function (strId) {
            if (strId) {
                //编辑加载数据
                $.getJSON('/API/VIEWAPI.ashx?Action=KCGL_GETKJGLMODEL', { P1: strId }, function (resultData) {

                    if (resultData.ErrorMsg == "") {
                        tempmodel.modelData = resultData.Result;
                        setTimeout(" ComFunJS.initForm()", 500);
                    }
                })
            } else {
                ComFunJS.initForm();
            }
        },//初始化
        FolderName: "",
        modelData: { "KJName": "", "KJDec": "", "KJType": 1, "KJZJR": "", "Files": "" },
        SaveData: function (callback) {

            $.post("/API/VIEWAPI.ashx?ACTION=KCGL_ADDKJGL", { P1: JSON.stringify(tempmodel.modelData.$model) }, function (result) {
                console.log(result);
                return callback.call(this, $.parseJSON(result));
            });
        }
    });

    tempmodel.$watch("modelData.*", function (a, b) {
        if (!tempmodel.modelData.ID) {
            localStorage.setItem(pmodel.FormCode, JSON.stringify(tempmodel.modelData.$model));
        }
    })
    //@ sourceURL=KCGL.js;
</script>
